﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;

namespace SpeedTest
{
	static class Program
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
        /// 
        static Mutex startMutex = new Mutex(false, "Speed Test Client");
		[STAThread]
		static void Main()
		{
            //See if another instance of the Speed Test client is running
            if (!startMutex.WaitOne(TimeSpan.FromSeconds(3), false))
            {
                MessageBox.Show("Another instance of the Speed Test Client is already running");
                return;
            }

			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			Application.Run(new MainForm());
            startMutex.ReleaseMutex();
		}
	}
}
